from bag_of_words import BagOfWords
from learning_agent import LearningAgent
from nearest_neighbor import NearestNeighbor

ToStem = True
ToEliminate = True

'''
Agents with bags of 10. 
'''
class Agent10_F_F(LearningAgent):
    def createFeatureExtractor(self):
        return BagOfWords(10,not ToStem,not ToEliminate)
    
    def createClassifier(self):
        return NearestNeighbor()
    
    def __str__(self):
        return '10 Words'+',NoStem,NoElim'

class Agent10_F_T(LearningAgent):
    def createFeatureExtractor(self):
        return BagOfWords(10,not ToStem,ToEliminate)
    
    def createClassifier(self):
        return NearestNeighbor()
    
    def __str__(self):
        return '10 Words'+',NoStem,Elim'

class Agent10_T_F(LearningAgent):
    def createFeatureExtractor(self):
        return BagOfWords(10,ToStem,not ToEliminate)
    
    def createClassifier(self):
        return NearestNeighbor()
    
    def __str__(self):
        return '10 Words'+',Stem,NoElim'
    
class Agent10_T_T(LearningAgent):
    def createFeatureExtractor(self):
        return BagOfWords(10,ToStem,ToEliminate)
    
    def createClassifier(self):
        return NearestNeighbor()
    
    def __str__(self):
        return '10 Words'+',Stem,Elim'

'''
Agents with bags of 30.
'''
class Agent30_F_F(LearningAgent):
    def createFeatureExtractor(self):
        return BagOfWords(30,not ToStem,not ToEliminate)
    
    def createClassifier(self):
        return NearestNeighbor()
    
    def __str__(self):
        return '30 Words'+',NoStem,NoElim'

class Agent30_F_T(LearningAgent):
    def createFeatureExtractor(self):
        return BagOfWords(30,not ToStem,ToEliminate)
    
    def createClassifier(self):
        return NearestNeighbor()
    
    def __str__(self):
        return '30 Words'+',NoStem,Elim'

class Agent30_T_F(LearningAgent):
    def createFeatureExtractor(self):
        return BagOfWords(30,ToStem,not ToEliminate)
    
    def createClassifier(self):
        return NearestNeighbor()
    
    def __str__(self):
        return '30 Words'+',Stem,NoElim'
    
class Agent30_T_T(LearningAgent):
    def createFeatureExtractor(self):
        return BagOfWords(30,ToStem,ToEliminate)
    
    def createClassifier(self):
        return NearestNeighbor()
    
    def __str__(self):
        return '30 Words'+',Stem,Elim'

'''
Agents with bags of 50.
'''
class Agent50_F_F(LearningAgent):
    def createFeatureExtractor(self):
        return BagOfWords(50,not ToStem,not ToEliminate)
    
    def createClassifier(self):
        return NearestNeighbor()
    
    def __str__(self):
        return '50 Words'+',NoStem,NoElim'

class Agent50_F_T(LearningAgent):
    def createFeatureExtractor(self):
        return BagOfWords(50,not ToStem,ToEliminate)
    
    def createClassifier(self):
        return NearestNeighbor()
    
    def __str__(self):
        return '50 Words'+',NoStem,Elim'

class Agent50_T_F(LearningAgent):
    def createFeatureExtractor(self):
        return BagOfWords(50,ToStem,not ToEliminate)
    
    def createClassifier(self):
        return NearestNeighbor()
    
    def __str__(self):
        return '50 Words'+',Stem,NoElim'
    
class Agent50_T_T(LearningAgent):
    def createFeatureExtractor(self):
        return BagOfWords(50,ToStem,ToEliminate)
    
    def createClassifier(self):
        return NearestNeighbor()
    
    def __str__(self):
        return '50 Words'+',Stem,Elim'

'''
Agents with bags of 70.
'''
class Agent70_F_F(LearningAgent):
    def createFeatureExtractor(self):
        return BagOfWords(70,not ToStem,not ToEliminate)
    
    def createClassifier(self):
        return NearestNeighbor()
    
    def __str__(self):
        return '70 Words'+',NoStem,NoElim'

class Agent70_F_T(LearningAgent):
    def createFeatureExtractor(self):
        return BagOfWords(70,not ToStem,ToEliminate)
    
    def createClassifier(self):
        return NearestNeighbor()
    
    def __str__(self):
        return '70 Words'+',NoStem,Elim'

class Agent70_T_F(LearningAgent):
    def createFeatureExtractor(self):
        return BagOfWords(70,ToStem,not ToEliminate)
    
    def createClassifier(self):
        return NearestNeighbor()
    
    def __str__(self):
        return '70 Words'+',Stem,NoElim'
    
class Agent70_T_T(LearningAgent):
    def createFeatureExtractor(self):
        return BagOfWords(70,ToStem,ToEliminate)
    
    def createClassifier(self):
        return NearestNeighbor()
    
    def __str__(self):
        return '70 Words'+',Stem,Elim'

'''
Agents with bags of 100.
'''
class Agent100_F_F(LearningAgent):
    def createFeatureExtractor(self):
        return BagOfWords(100,not ToStem,not ToEliminate)
    
    def createClassifier(self):
        return NearestNeighbor()
    
    def __str__(self):
        return '100 Words'+',NoStem,NoElim'

class Agent100_F_T(LearningAgent):
    def createFeatureExtractor(self):
        return BagOfWords(100,not ToStem,ToEliminate)
    
    def createClassifier(self):
        return NearestNeighbor()
    
    def __str__(self):
        return '100 Words'+',NoStem,Elim'

class Agent100_T_F(LearningAgent):
    def createFeatureExtractor(self):
        return BagOfWords(100,ToStem,not ToEliminate)
    
    def createClassifier(self):
        return NearestNeighbor()
    
    def __str__(self):
        return '100 Words'+',Stem,NoElim'
    
class Agent100_T_T(LearningAgent):
    def createFeatureExtractor(self):
        return BagOfWords(100,ToStem,ToEliminate)
    
    def createClassifier(self):
        return NearestNeighbor()
    
    def __str__(self):
        return '100 Words'',Stem,Elim'
    
class AgentStirlitz(LearningAgent):
    def __init__(self, _bagSize, _toStem, _toElim, _th):
        self.bagSize = _bagSize
        self.toStem = _toStem
        self.toElim = _toElim
        self.th = _th
    
    def createFeatureExtractor(self):
        return BagOfWords(self.bagSize,self.toStem,self.toElim,self.th)
    
    def createClassifier(self):
        return NearestNeighbor()
    
    def __str__(self):
        retval = str(self.bagSize)+' Words, '
        if self.toStem: retval += 'Stem, '
        else: retval += 'NoStem, '
        if self.toElim: retval += 'Elim'
        else: retval += 'NoElim'
        return retval

agents10 =  [Agent10_F_F, Agent10_F_T, Agent10_T_F, Agent10_T_T]
agents30 =  [Agent30_F_F, Agent30_F_T, Agent30_T_F, Agent30_T_T]
agents50 =  [Agent50_F_F, Agent50_F_T, Agent50_T_F, Agent50_T_T]
agents70 =  [Agent70_F_F, Agent70_F_T, Agent70_T_F, Agent70_T_T]
agents100 = [Agent100_F_F, Agent100_F_T, Agent100_T_F, Agent100_T_T]
impAgents = [Agent10_T_T, Agent30_T_T, Agent50_T_T, Agent70_T_T]

